<template>
  <div>
    <h2>Home组件内容</h2>
    <div>
      <ul class="nav nav-tabs">
        <!-- 使用router-link方法实现路由的切换  -->
        <!-- active-class 用于该元素被激活时的样式-->
        <li>
          <router-link to="/home/message" class="list-group-item" active-class="active">Message</router-link>
        </li>
        <li>
          <router-link to="/home/news" class="list-group-item" active-class="active">News</router-link>
        </li>
      </ul>
      <!-- 指定组件的呈现位置 -->
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "Home",
  // 销毁生命周期勾子
  // beforeDestroy() {
  //   console.log("About即将被销毁")
  // },
  // mounted() {
  //   console.log("Home组件挂载完毕", this)
  //   window.homeRoute = this.$route
  //   window.homeRouter = this.$router
  // },
}
</script>

<style lang="scss" scoped></style>